package com.bdqn.service;

import com.bdqn.entity.OuProjectOrder;
import com.bdqn.mapper.OuProjectOrderMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;

import javax.annotation.Resource;
import java.util.Date;
import java.util.UUID;

/**
 * Created by Administrator on 2015/8/28.
 */
@Service
@Transactional
public class TestService {

    @Resource
    OuProjectOrderMapper projectOrderMapper;

    @Transactional
    public boolean insert() {
        try {
            OuProjectOrder o = new OuProjectOrder();
            o.setOrderId(UUID.randomUUID().toString());
            o.setCreateDate(new Date());
            o.setCreateUserId(UUID.randomUUID().toString());
            o.setEndDate(new Date());
            o.setManagerId(UUID.randomUUID().toString());
            o.setOrderCategory(1);
            o.setPlanBeginDate(new Date());
            o.setPlanEndDate(new Date());
            o.setSerialNumber(UUID.randomUUID().toString());
            o.setStatus(1);
            o.setSubtitle("aaa");
            o.setTitle("AAAAAAAA");
            o.setUrgentM(1);
            projectOrderMapper.insertSelective(o);

        }catch (Exception e){
            e.printStackTrace();
        }
        String[] a = {};
        System.out.println(a[10]);
        System.out.println("success!");
        return true;
    }
}
